import logging
import logging_use
import requests


logging_use.init_log_config("test.log")
# logging.debug()
# logging.info()
logging.debug("8888888")
logging.error("这是一条错误日志")
logging.critical("这是一条严重的错误日志")

try:
    url = "http://www.baidu.com"
    resp = requests.get(url=url)
    logging.info(f"请求的地址={url}")
    logging.info(f"请求的响应结果是={resp.text}")


except Exception as err:
    logging.error(f"请求的错误日志={str(err)}")
finally:
    logging.info("请求执行完毕")


